package com.chaoxing.entity;

public enum SignType {
    NORMAL(0, "普通签到"),
    PHOTO(1, "拍照签到"),
    QRCODE(2, "二维码签到"),
    GESTURE(3, "手势签到"),
    LOCATION(4, "位置签到"),
    CODE(5, "签到码签到");
    
    private final int code;
    private final String description;
    
    SignType(int code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public int getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    public static SignType fromCode(int code) {
        for (SignType type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        return NORMAL;
    }
}